package com.wk.entity;

import java.util.concurrent.LinkedBlockingDeque;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

public class ThreadPollUtil {
    private static int corePoolSize = Runtime.getRuntime().availableProcessors();

    /*
    *
    * corePoolSize ==>核心线程数量
    * maxiNumPoolSize ==>指定最大线程数
    * keepAliveTime和TimeUnit指定线程空闲后的最大存活时间
    *
     */
    public static ThreadPoolExecutor executor = new ThreadPoolExecutor(corePoolSize,corePoolSize+1,10L, TimeUnit.SECONDS,new LinkedBlockingDeque<Runnable>(1000));
}
